<?php
class Oeuvres_prefere extends Controller {
	
function Oeuvres_prefere()
	{
		parent::Controller();	
		$this->load->library('tank_auth');
		$this->lang->load('tank_auth');
		
	}

function index()
	{
		$this->load->view('layout/header');
		$this->load->view('layout/footer');
	}





function get($user_id){
    	
    	$this->db->select('piece_id');
    	$this->db->from('favoritepieces');
    	$this->db->where('user_id', $user_id);
    	$this->db->join('pieces AS u', 'u.id = favoritepieces.piece_id');
    	$query = $this->db->get();
    	return $query->result();
    }